<html>
<head><title>"Rename This" Options</title></head>
<script type="text/javascript">

// Saves options to localStorage.
function save_options()
{
	var checkbox = document.getElementById("auto_rename");
	localStorage["auto_rename"] = checkbox.value;

	// Update status to let user know options were saved.
	var status = document.getElementById("status");
	status.innerHTML = "Options Saved.";
	setTimeout(function() {
		status.innerHTML = "";
	}, 750);
}

// Restores select box state to saved value from localStorage.
function restore_options()
{
	var auto_rename = localStorage["auto_rename"];
	var checkbox = document.getElementById("auto_rename");
	checkbox.checked = "checked" ? auto_rename : "";
}

</script>

<body onload="restore_options()">

<h1>"Rename This" Options</h1>

<p>
	<input type="checkbox" id="auto_rename"/>
	Automatically rename tab when title changes?
</p>

<p>
	<button onclick="save_options()">Save</button>
</p>

<p id="status"></p>

</body>
</html>
